﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.ComponentModel.Design;
using BPM.Base.WFLib.GuideForm;

namespace BPM.Base.WFLib
{
    public class WaitSubmitDesigner : ActivityDesigner
    {
        
        protected override System.Collections.ObjectModel.ReadOnlyCollection<DesignerAction> DesignerActions
        {
            get
            {
                List<DesignerAction> list = new List<DesignerAction>();
                foreach (DesignerAction temp in base.DesignerActions)
                {
                    list.Add(new DesignerAction(this, temp.ActionId, temp.Text));
                }
                return list.AsReadOnly();
            }
        }

        protected override ActivityDesignerVerbCollection Verbs
        {
            get
            {
                ActivityDesignerVerbCollection NewVerbs = new ActivityDesignerVerbCollection();
                NewVerbs.AddRange(base.Verbs);

                ActivityDesignerVerb menu0 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "查看", new EventHandler(menu0_click));
                NewVerbs.Add(menu0);


                ActivityDesignerVerb l = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "-", new EventHandler(l_click));
                NewVerbs.Add(l);


                ActivityDesignerVerb menu1 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "设置[到人]", new EventHandler(menu1_click));
                NewVerbs.Add(menu1);

                ActivityDesignerVerb menu2 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "设置[组接件]", new EventHandler(menu2_click));
                NewVerbs.Add(menu2);

                ActivityDesignerVerb menu3 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "设置[组分配]", new EventHandler(menu3_click));
                NewVerbs.Add(menu3);

                ActivityDesignerVerb menu4 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "设置[组接件组分配]", new EventHandler(menu4_click));
                NewVerbs.Add(menu4);

                ActivityDesignerVerb menul = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "-", new EventHandler(menul_click));
                NewVerbs.Add(menul);

                ActivityDesignerVerb menu5 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "可查看的数据表单", new EventHandler(menu5_click));
                NewVerbs.Add(menu5);

                ActivityDesignerVerb menu6 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "可添写的数据表单", new EventHandler(menu6_click));
                NewVerbs.Add(menu6);
                ActivityDesignerVerb menull = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "-", new EventHandler(menul_click));
                NewVerbs.Add(menul);

                ActivityDesignerVerb menu7 = new ActivityDesignerVerb(this, DesignerVerbGroup.View, "管理权限", new EventHandler(menu7_click));
                NewVerbs.Add(menu7);
                return NewVerbs;
            }
        }


        private void menu0_click(object sender, EventArgs e)
        {
            等待提交 activity = this.Activity as 等待提交;
            switch (activity.处理方式)
            {
                case "到人":
                    using (ToUser wf = new ToUser(this))
                    {
                        wf.ShowDialog();
                    }
                    break;
                case "组接件":
                    using (incept wf = new incept(this))
                    {


                        wf.ShowDialog();
                    }
                    break;
                case "组分配":

                    using (assign wf = new assign(this))
                    {

                        wf.ShowDialog();
                    }
                    break;
                case "组接件组分配":
                    using (inceptassign wf = new inceptassign(this))
                    {
                        wf.ShowDialog();
                    }
                    break;
                case "子流程回归":
                    System.Windows.Forms.MessageBox.Show("[处理方式]为[子流程回归],只能在属性栏中查看");

                    break;

                case "动态到人":
                case "动态组接件":
                case "动态组分配":
                case "动态组接件组分配":
                    System.Windows.Forms.MessageBox.Show("[处理方式]为[动态],只能在属性栏中查看");
                    break;
                   
                default :
                    System.Windows.Forms.MessageBox.Show("你还没的设置[处理方式]");
                    break;

            }




        }



        private void menu1_click(object sender, EventArgs e)
        {

            using (ToUser wf = new ToUser(this))
            {

               

                wf.ShowDialog();
            }


        }

        private void menu2_click(object sender, EventArgs e)
        {

            using (incept wf = new incept(this))
            {

      
                wf.ShowDialog();
            }


        }

        private void menu3_click(object sender, EventArgs e)
        {

            using (assign wf = new assign(this))
            {

                wf.ShowDialog();
            }


        }

        private void menu4_click(object sender, EventArgs e)
        {

            using (inceptassign wf = new inceptassign(this))
            {
               wf.ShowDialog();
            }


        }
       
        private void menu5_click(object sender, EventArgs e)
        {

            using (DForm wf = new DForm(this,"see"))
            {
                wf.ShowDialog();
            }

        }

        private void menu6_click(object sender, EventArgs e)
        {
            using (DForm wf = new DForm(this, "edit"))
            {
                wf.ShowDialog();
            }
       
        }

        private void menu7_click(object sender, EventArgs e)
        {


        }

        private void menul_click(object sender, EventArgs e)
        {

        }
        private void l_click(object sender, EventArgs e)
        {

        }
    }


}
